home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 25 / CU Amiga Magazine's Super CD-ROM 25 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-08].iso / CUCD / Programming / ixemul / sdk / man / cat4 / pty.0 < prev    next >
Encoding:
Text File  |  1998-06-15  |  6.0 KB  |  115 lines

  1.  
  2. PTY(4)                     UNIX Programmer's Manual                     PTY(4)
  3.  
  4. NNAAMMEE
  5.      ppttyy - pseudo terminal driver
  6.  
  7. SSYYNNOOPPSSIISS
  8.      ppsseeuuddoo--ddeevviiccee ppttyy [_c_o_u_n_t]
  9.  
  10. DDEESSCCRRIIPPTTIIOONN
  11.      The pty driver provides support for a device-pair termed a _p_s_e_u_d_o
  12.      _t_e_r_m_i_n_a_l. A pseudo terminal is a pair of character devices, a _m_a_s_t_e_r de-
  13.      vice and a _s_l_a_v_e device.  The slave device provides to a process an in-
  14.      terface identical to that described in tty(4).  However, whereas all oth-
  15.      er devices which provide the interface described in tty(4) have a hard-
  16.      ware device of some sort behind them, the slave device has, instead, an-
  17.      other process manipulating it through the master half of the pseudo ter-
  18.      minal.  That is, anything written on the master device is given to the
  19.      slave device as input and anything written on the slave device is pre-
  20.      sented as input on the master device.
  21.  
  22.      In configuring, if an optional _c_o_u_n_t is given in the specification, that
  23.      number of pseudo terminal pairs are configured; the default count is 32.
  24.  
  25.      The following ioctl(2) calls apply only to pseudo terminals:
  26.  
  27.      TIOCSTOP    Stops output to a terminal (e.g. like typing `^S'). Takes no
  28.                  parameter.
  29.  
  30.      TIOCSTART   Restarts output (stopped by TIOCSTOP or by typing `^S').
  31.                  Takes no parameter.
  32.  
  33.      TIOCPKT     Enable/disable _p_a_c_k_e_t mode.  Packet mode is enabled by speci-
  34.                  fying (by reference) a nonzero parameter and disabled by
  35.                  specifying (by reference) a zero parameter.  When applied to
  36.                  the master side of a pseudo terminal, each subsequent read
  37.                  from the terminal will return data written on the slave part
  38.                  of the pseudo terminal preceded by a zero byte (symbolically
  39.                  defined as TIOCPKT_DATA), or a single byte reflecting control
  40.                  status information.  In the latter case, the byte is an in-
  41.                  clusive-or of zero or more of the bits:
  42.  
  43.                  TIOCPKT_FLUSHREAD   whenever the read queue for the terminal
  44.                                      is flushed.
  45.  
  46.                  TIOCPKT_FLUSHWRITE  whenever the write queue for the terminal
  47.                                      is flushed.
  48.  
  49.                  TIOCPKT_STOP        whenever output to the terminal is
  50.                                      stopped a la `^S'.
  51.  
  52.                  TIOCPKT_START       whenever output to the terminal is
  53.                                      restarted.
  54.  
  55.                  TIOCPKT_DOSTOP      whenever _t___s_t_o_p_c is `^S' and _t___s_t_a_r_t_c is
  56.                                      `^Q'.
  57.  
  58.                  TIOCPKT_NOSTOP      whenever the start and stop characters
  59.                                      are not `^S/^Q'.
  60.  
  61.                                      While this mode is in use, the presence
  62.                                      of control status information to be read
  63.                                      from the master side may be detected by a
  64.                                      select(2) for exceptional conditions.
  65.  
  66.  
  67.                                      This mode is used by rlogin(1) and
  68.                                      rlogind(8) to implement a remote-echoed,
  69.                                      locally `^S/^Q' flow-controlled remote
  70.                                      login with proper back-flushing of out-
  71.                                      put; it can be used by other similar pro-
  72.                                      grams.
  73.  
  74.      TIOCUCNTL   Enable/disable a mode that allows a small number of simple
  75.                  user ioctl commands to be passed through the pseudo-terminal,
  76.                  using a protocol similar to that of TIOCPKT. The TIOCUCNTL
  77.                  and TIOCPKT modes are mutually exclusive.  This mode is en-
  78.                  abled from the master side of a pseudo terminal by specifying
  79.                  (by reference) a nonzero parameter and disabled by specifying
  80.                  (by reference) a zero parameter.  Each subsequent read from
  81.                  the master side will return data written on the slave part of
  82.                  the pseudo terminal preceded by a zero byte, or a single byte
  83.                  reflecting a user control operation on the slave side.  A us-
  84.                  er control command consists of a special ioctl operation with
  85.                  no data; the command is given as UIOCCMD(n), where _n is a
  86.                  number in the range 1-255.  The operation value _n will be re-
  87.                  ceived as a single byte on the next read from the master
  88.                  side.  The ioctl UIOCCMD(0) is a no-op that may be used to
  89.                  probe for the existence of this facility.  As with TIOCPKT
  90.                  mode, command operations may be detected with a select for
  91.                  exceptional conditions.
  92.  
  93.      TIOCREMOTE  A mode for the master half of a pseudo terminal, independent
  94.                  of TIOCPKT. This mode causes input to the pseudo terminal to
  95.                  be flow controlled and not input edited (regardless of the
  96.                  terminal mode).  Each write to the control terminal produces
  97.                  a record boundary for the process reading the terminal.  In
  98.                  normal usage, a write of data is like the data typed as a
  99.                  line on the terminal; a write of 0 bytes is like typing an
  100.                  end-of-file character.  TIOCREMOTE can be used when doing re-
  101.                  mote line editing in a window manager, or whenever flow con-
  102.                  trolled input is required.
  103.  
  104. FFIILLEESS
  105.      /dev/pty[p-r][0-9a-f]   master pseudo terminals
  106.      /dev/tty[p-r][0-9a-f]   slave pseudo terminals
  107.  
  108. DDIIAAGGNNOOSSTTIICCSS
  109.      None.
  110.  
  111. HHIISSTTOORRYY
  112.      The ppttyy driver appeared in 4.2BSD.
  113.  
  114. 4.2 Berkeley Distribution      November 30, 1993                             2
  115.